<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
<script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.5"></script>
<script> 
var contextPath='${contextPath}';
var _contextPath ='${staticServer}';
var save = function(){
    var tuijian_type = $("#tuijian_type").val();
    var id = $("#id").val();
    var mingxi = $("#mingxi").val();
    var stu_id = $("#stu_id").val();
    var cishu = $("#cishu").val();
    var baoming_date = $("#baoming_date").val();
    var mqkeci = $("#mqkeci").val();
    var tuijian_name = $("#tuijian_name").val();
    var tuijian_time1 = $("#tuijian_time1").val();
    var tuijian_time2 = $("#tuijian_time2").val();
    var tuijian_time3 = $("#tuijian_time3").val();
    var content1 = $("#content1").val();
    var content2 = $("#content2").val();
    var content3 = $("#content3").val();
    var tuijian_dj = $("#tuijian_dj").val();
    var tuijian_kes = $("#tuijian_kes").val();
    var tjstu_time = $("#tjstu_time").val();
    var guanxi = $("#guanxi").val();
    var is_canyu = $("#is_canyu").val();
    var guanxi = $("#guanxi").val();
    var tuijian_tea = $("#tuijian_tea").val();
    var pz_url = $("#fw").val();
    var data_url = $("#all_words4").val();
    
   $.post("${contextPath}/index/tuijian_student_save.json",{
    	"tuijian_type":tuijian_type,
    	"id" : id,
    	"mingxi" : mingxi,
    	"stu_id":stu_id,
    	"cishu":cishu,
    	"baoming_date":baoming_date,
		"mqkeci" : mqkeci,
		"tuijian_name":tuijian_name,
		"tuijian_time1":tuijian_time1,
		"tuijian_time2":tuijian_time2,
		"tuijian_time3":tuijian_time3,
		"content1":content1,
		"content2":content2,
		"content3":content3,
		"tuijian_dj":tuijian_dj,
		"tuijian_kes":tuijian_kes,
		"tjstu_time":tjstu_time,
		"guanxi":guanxi,
		"tuijian_tea":tuijian_tea,
		"is_canyu":is_canyu,
		"url":pz_url,
		"data_url":data_url
		}, function(ms) {
	      if(ms.msg == "1"){
		     	infopad.msg("添加成功");
			  	setTimeout(function(){
				window.location.href=encodeURI("${contextPath}/index/tuijianList.htm");
			},1000);
	      }else{
	      		alert("抱歉，系统忙,请重新保存！");
	      }
	});
}

var deleteImgfw = function(id,url){
	$("#"+id).remove();
	var s=$("#fw").val();
	s = s.replace(","+url,"");
	s = s.replace(url,"");
	$("#fw").val(s);
}

$(function(){
	$("#nickname1").change(function(){
		var nickname = $("#nickname1").val();
		if(nickname==""){
			$("#jd_username1").val("");
			return;
		}
		$.post("${contextPath}/index/getstudentByname2.json", {
			"nickname" : nickname
		}, function(ms) {
			 if(ms.user!=null){
			 	var id = ms.user.id;
			 	var name = ms.user.nickname;
	//		 	$("#stu_id").val(name);
	
			 	uhtml ='<option value="'+id+'">'+name+'</option>';
			 	$("#stu_id").html(uhtml);
			 }
			
		});
	});
});

</script>
<style type="text/css">
#statelist label {
	display: block;
	float: left;
	width: 120px;
}
</style>
<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
#SWFUpload_1{
	margin-top: 70px;
    margin-left: -30px;
}
.SEARCH_hide h3 {
    overflow: hidden;
    height: 8px;
    line-height: 16px;
    color: #a6a6a6;
    font-weight: 400;
    font-size: 14px;
    padding: 8px 15px 10px 15px;
}
.SEARCH_hide {
    position: absolute;
    width: 238px;
    box-shadow: 0 2px 2px #e5e5e5;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    z-index: 99;
}
.SEARCH_hideL {
    float: left;
    width: 238px;
    height: 400px;
    overflow: hidden;
    border-right: 1px solid #e5e5e5;
}
</style>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">推荐学员登记</li>
		</ul>
	</div>
	<div id="container">
		<table id="infotable">
			<tr class="fields">
				<th colspan="2">被推荐学员基本资料(成单前的必填明细)：</th>
			</tr>
			<tr>
				<th width="25%">推荐类别： </th>
				<td width="75%">
				<select id="tuijian_type">
					<option value="">请选择</option>
					<option value="学员家长推荐">学员家长推荐</option>
					<option value="自主开发">自主开发</option>
				</select>
				<input type="text" style="display: none;" id="mingxi" placeholder="请填写资源来源明细情况" value=""/>(必填)
				</td>
			</tr>
			<tr>
				<th>推荐学员：</th>
				<td><select id="stu_id">
             			<option value="">请选择</option>
             			<#if list??>
             				<#list list as student>
             					<#if student??>
								<option value="${student.id}">${student.name}</option>
								</#if>
							</#list>
						</#if>
					</select>
					(必填)<input type="text" id="nickname1" size="15" maxlength="10" placeholder="输入姓名快捷匹配">
				</td>
				
			</tr>
			<tr rel="hide2">
				<th>第几次推荐：</th>
				<td><input id="cishu" size="20" class="off_input"/> (这里要填写数字) </td>
			</tr>
			<tr>
				<th>入学时间：</th>
				<td><input type="text" id="baoming_date" size="20" maxlength="20" rel="DATE::Y-m-d" /></td>
			</tr>
			<tr>
				<th>目前上课次数：</th>
				<td><input type="text" id="mqkeci" value="" class="off_input"></td>
			</tr>
			<tr>
				<th>被推荐学员名字：</th>
				<td><input type="text" id="tuijian_name" value="" class="off_input">(请正确填写姓名，避免错别字)(必填)</td>
			</tr>
			<tr>
				<th>与推荐人谈推荐的时间、内容(第一次)： </th>
				<td><input type="text" id="tuijian_time1" size="20" maxlength="20" rel="DATE::Y-m-d" />
			 	<input type="text" id="content1" value="" size="50" class="off_input">(必填)</td>
			</tr>
			<tr>
				<th>与推荐人谈推荐的时间、内容(第二次)：</th>
				<td><input type="text" id="tuijian_time2" size="20" maxlength="20" rel="DATE::Y-m-d" />
				<input type="text" id="content2" value=""  size="50" class="off_input">(必填)</td>
			</tr>
			<tr>
				<th>与推荐人谈推荐的时间、内容(第三次)：</th>
				<td><input type="text" id="tuijian_time3" size="20" maxlength="20" rel="DATE::Y-m-d" />
				<input type="text" id="content3" value="" size="50">(必填)</td>
			</tr>
			<tr>
				<th>推荐人动机：</th>
				<td><input type="text" id="tuijian_dj" value="" size="50">(必填)</td>
			</tr>
			<tr>
				<th>具体许诺推荐人的赠送课时或返学费情况： </th>
				<td><input id="tuijian_kes"  type="number" size="30" value="" placeholder="赠送课时数" />次。(必填)</td>
			</tr>
			<tr>
				<th>知道推荐人将要推荐该学生的日期：</th>
				<td><input type="text" id="tjstu_time" size="20" maxlength="20" rel="DATE::Y-m-d" /></td>
			</tr>
			<tr>
				<th>被推荐人与推荐人的关系：</th>
				<td><input type="text" id="guanxi" value=""  size="50">(必填)</td>
			</tr>
			<tr>
				<th>是否有其他老师参与推荐：</th>
				<td>
					<select id="tuijian_tea">
						<option value="">请选择</option>
						<#if teaList??>
							<#list teaList as list>
								<#if list.name!="${webutil.getCookieUser().name}">
									<option value="${list.id}">${list.name}</option>
								</#if>
							</#list>
						</#if>
					</select>
					(如果有其他老师参与推荐，就填上)
				</td>
			</tr>
            <tr>
				<th>上传证明材料（图片）:<br/>(单击图片可删除)</th>
				<td>
					<ul class="imglist">
					<div id="imagesfw" style="float: left;">
						<#if tuiJian?? && tuiJian.url?? && tuiJian.url!="">
							<#list tuiJian.url?split(",") as imgurl>
								<#if imgurl_index !=0>
								<li id="${imgurl?replace('http://120.55.241.58/','')?substring(25,30)}" onclick="deleteImgfw('${imgurl?replace('http://120.55.241.58/','')?substring(25,30)}','${imgurl}')" style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><img rel="800:485" width="180" height="109.125" src="http://120.55.241.58/${imgurl}"></li>
								</#if>
							</#list>
						</#if>
					</div>
					<a class="file_box" style="list-style-type: none;float: left;display: block; width:180px; height:180px; overflow: hidden; border: 1px solid #EBEBEB; background: none repeat scroll 0 0 #F3F3F3; color: #999999; cursor: pointer; text-align: center; margin-left:10px; ">
                    <em style="background:url(${staticServer}/img/add_newpic.png) 0 0; display: inline-block; width:180px; height:180px; overflow: hidden;line-height: 20em; vertical-align: middle;">
                    <input type="file" id="uploadfw" style="display: block;width:180px; height:180px;opacity: 0; filter:alpha(opacity=0); "></em>
                    </a>
                    <label class="zt_widthlabel" style=" font-size:9px; float:left; visibility:hidden;">文件：</label>
                    <input type="text" id="fw" value="<#if tuiJian??>${tuiJian.url}</#if>" style=" width:100px; height:10px; float:left;visibility:hidden;" class="input w180" value="">
					</ul>
				</td>
			</tr>
			<tr>
				<th>上传相关文件:</th>
				<td>
					<ul class="imglist">
					<div id="images4" style="float: left;">
						<#if tuiJian?? && tuiJian.data_url?? && tuiJian.data_url!="">
							<#list tuiJian.data_url?split(",") as dataurl>
								<#if dataurl_index !=0>
								<li style="float:left;list-style-type: none;line-height:180px;*font-size:157px;"><a href="http://www.yueqiao.org${dataurl}">文件下载</a></li>
								</#if>
							</#list>
						</#if>
					</div>
						
					<a class="file_box" style="list-style-type: none;float: left;display: block; width:180px; height:180px; overflow: hidden; border: 1px solid #EBEBEB; background: none repeat scroll 0 0 #F3F3F3; color: #999999; cursor: pointer; text-align: center; margin-left:10px; ">
                    <em style="background:url(${staticServer}/img/add_newpic.png) 0 0; display: inline-block; width:180px; height:180px; overflow: hidden;line-height: 20em; vertical-align: middle;">
                    <input type="file" id="upload4" style="display: block;width:180px; height:180px;opacity: 0; filter:alpha(opacity=0); "></em>
                    </a>
                    <label class="zt_widthlabel" style=" font-size:9px; float:left; visibility:hidden;">文件：</label>
                    <input type="text" id="all_words4" style=" width:100px; height:10px; float:left;visibility:hidden;" class="input w180" value="<#if tuiJian??>${tuiJian.data_url}</#if>">
					<input value="" type="hidden" id="oname" >
					</ul>
				</td>
			</tr>
			<br/>
			<tr><th><font color="red"><h4>请检查是否填写正确</h4></font></th>
				<td align="center" ><input type="button"  value=" 保存客户推荐记录 " onclick="save()" class="submit" id="easyDialogYesBtn"/> </td>
			</tr>
	</table>
</body>
</html>